package test.laji;

public class SanDome {

    public static void  main(String[] arg0)
    {
        plSan(5);

    }
    public static void plSan(int a){
        if (a<=0)
        {
            System.out.println("数据不符合规范");
            return;
        }
        else {
            if (a%2!=0) { //奇数
                 int c=1;
                for (int i = 0; i < a; i++) {

                    if (i < (a/2)+1) {           //根据中间数前面的递归
                        for (int j =i; j >= 0; j--) {
                            System.out.print("*");
                        }
                        System.out.println();
                    }else{
                        //根据中间数后的递归
                        for (int j = (i-c); j > 0; j--) {
                            System.out.print("*");
                        }
                        System.out.println();
                        c=c+2;
                    }
                }
            }
            else {
                System.out.println("非奇数");
                return;

            }
        }

    }
}